# -*- encoding: utf-8 -*-
"""
File Name: request_template
Description:
Author : 'lirui'
date: 2024/1/8
Contact: marjey_lee@163.com
Change Activity:
2024/1/8:
"""
user = dict(
    get={
        "jsonrpc": "2.0",
        "method": "user.get",
        "params": {
            "output": "extend"
        },
        "id": 1},
    login={
        "jsonrpc": "2.0",
        "method": "user.login",
        "params": {
            "username": None,
            "password": None
        },
        "id": 1
    },
    logout={
        "jsonrpc": "2.0",
        "method": "user.logout",
        "params": [],
        "id": 1
    }
)
items = dict(
    create_dedicated_line_http_proxy={
        "jsonrpc": "2.0",
        "method": "item.create",
        "params": {
            "name": None,
            "key_": None,
            "hostid": None,
            "type": 19,
            "value_type": 0,
            "delay": "2m",
            'history': '30d',
            'trends': '180d',
            'url': None
        },
        "id": 1
    }
)

host = dict(
    get={
        "jsonrpc": "2.0",
        "method": "host.get",
        "params": {
            "filter": {

            }
        },
        "id": 1
    },
    delete={
        "jsonrpc": "2.0",
        "method": "host.delete",
        "params":
            [

            ],
        "id": 1
    },
    create_dedicated_line_host={
        "jsonrpc": "2.0",
        "method": "host.create",
        "params": {
            "host": "dedicated_line",
            "groups": [
                {
                    "groupid": None
                }
            ],
            "tags": [
                {
                    "tag": "Host name",
                    "value": "dedicated_line"
                }
            ],
        },
        "id": 1
    },
    create_branch_dedicated_line_host={
        "jsonrpc": "2.0",
        "method": "host.create",
        "params": {
            "host": "branch_dedicated_line",
            "groups": [
                {
                    "groupid": None
                }
            ],
            "tags": [
                {
                    "tag": "Host name",
                    "value": "branch_dedicated_line"
                }
            ],
        },
        "id": 1
    },
    create_host={
        "jsonrpc": "2.0",
        "method": "host.create",
        "params": {
            "host": None,
            "groups": [
                {
                    "groupid": None
                }
            ],
        },
        "id": 1
    },
    create_snmp={
        "jsonrpc": "2.0",
        "method": "host.create",
        "params": {
            "host": None,
            "templates": [
                {"templateid": None}
            ],
            "interfaces": [
                {
                    "type": 2,
                    "main": 1,
                    "useip": 1,
                    "ip": None,
                    "dns": "",
                    "port": "161",
                    "details": {
                        "version": 2,
                        "bulk": 1,
                        "community": None,
                        "max_repetitions": "10"
                    }
                }
            ],
            "groups": [
                {
                    "groupid": None
                }
            ]
        },
        "id": 1
    },
    update={
        "jsonrpc": "2.0",
        "method": "host.update",
        "params": {
            "hostid": "10126",

        },
        "id": 1
    }
)
group = dict(
    get_groups={
        "jsonrpc": "2.0",
        "method": "hostgroup.get",
        "params": {
            "output": "extend",
            "filter": {
                "name": None
            }
        },
        "id": 1
    }
)
interface = dict(
    get={
        "jsonrpc": "2.0",
        "method": "hostinterface.get",
        "params": {
            "output": "extend",
            "hostids": None
        },
        "id": 1
    }
)
template = dict(
    get={
        "jsonrpc": "2.0",
        "method": "template.get",
        "params": {
            "output": "extend",
            "filter": {

            }
        },
        "id": 1
    }
)
problems = dict(
    hosts_with_problems={
        "jsonrpc": "2.0",
        "method": "host.get",
        "params": {
            "output": [
                "name"
            ],
            "severities": [1, 2, 3, 4, 5]
        },
        "id": 1
    },
    get={
        "jsonrpc": "2.0",
        "method": "problem.get",
        "params": {
            "hostids": None,
            "selectAcknowledges": "extend",
            "selectTags": "extend",
            "selectSuppressionData": "extend",
            "sortfield": [
                "eventid"
            ],
            "sortorder": "DESC"  # trigger
        },
        "id": 1
    }
)
trigger = dict(
    get_problem_trigger={
        "jsonrpc": "2.0",
        "method": "trigger.get",
        "params": {
            "output": [
                "event_name",
                "triggerid",
                "description",
                "priority",
                'expression',
                "recovery_mode"
            ],
            "filter": {
                "value": 1
            },
        },
        "id": 1
    }
)
